#include <bits/stdc++.h>
using namespace std;
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
using ll = long long;
string s[110];
ll n;
string ss = "yizhong";
int dx[8] = {0, -1, -1, -1, 0, 1, 1, 1};
int dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
ll vis[110][110];
void dfs(int x, int y)
{
    for (int i = 0; i < 8; i++)
    {
        int flag = 1;
        for (int j = 0; j < ss.size(); j++)
        {
            int nx = x + j * dx[i], ny = y + j * dy[i];
            if (nx < 0 || nx >= n || ny < 0 || ny >= n || s[nx][ny] != ss[j])
            {
                flag = 0;
                break;
            }
        }
        if (flag)
        {
            for (int j = 0; j < ss.size(); j++)
            {
                int nx = x + j * dx[i], ny = y + j * dy[i];
                vis[nx][ny] = 1;
            }
        }
    }
}
void solve()
{
    cin >> n;
    for (ll i = 0; i < n; i++)
    {
        cin >> s[i];
    }
    for (ll i = 0; i < n; i++)
    {
        for (ll j = 0; j < n; j++)
        {
            if (s[i][j] == 'y')
            {
                dfs(i, j);
            }
        }
    }

    for (ll i = 0; i < n; i++)
    {
        for (ll j = 0; j < n; j++)
        {
            if(vis[i][j]==1)
            {
                cout << s[i][j];
            }
            else {
                cout<<"*";
            }
        }
        cout << endl;
    }

}
int main()
{
    int t = 1;
    // cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}
